function ujY = UjY(uij, Y, j, data, k, m)
    top = 0;
    but = 0;
    
    numOfData = size(data, 3);
    dis = zeros(numOfData, 1);
    for i = 1:numOfData
       dis(i) = Distance2D(Y, data(:,:,i));
    end
    
    [ndis, nIndex] = sort(dis);
    for i = 1:k
        top = top + uij(nIndex(i), j) * ndis(i).^(-2/(m-1));
        but = but + 1 / ndis(i).^(2/(m-1));
    end
    ujY = top / but;
end